#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<char> v;
    int min = 1001;
    string s;
    cin >> s;

    int arr[26] = { 0 };
    for (auto& str : s) 
    {
        arr[str - 'a']++;
    }

    for (int i = 0; i < 26; ++i)
    {
        if (arr[i] == 1)
            v.push_back(i+'a');
    }

    for (int i = 0; i < v.size(); ++i)
    {
        for (int j = 0; j < s.size(); ++j)
        {
            if (v[i] == s[j] && j < min)
            {
                min = j;
                break;
            }
        }
    }

    if (!v.empty())
        cout << s[min] << endl;
    else
        cout << -1 << endl;

    return 0;
}